//-------------------------------------------------------------------
//	Copyright (c) 2010-2012 Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#ifndef _UX_IMAGE_LOADER_H
#define _UX_IMAGE_LOADER_H

#include "LoaderHeaders.h"

namespace Engine
{
namespace Loaders
{
	struct TImageInfo
	{
		uvec3				vDimension;
		e_tex_format::type	eFormat;
		e_tex_swizzle::type	eSwizzle;
		e_image::type		eType;
		bool				bCompressed;
		///
		TImageInfo():
			eFormat(e_tex_format::UNKNOWN), eSwizzle(e_tex_swizzle::AUTO),
			eType(e_image::UNKNOWN), bCompressed(false) {}
	};


	bool GetImageType(IFilePtr pFile, e_image::type &eType);
	bool GetImageInfo(IFilePtr pFile, TImageInfo &sInfo);

	bool LoadImage1D(IFilePtr pFile, TImage1D &sImage);				// T1D, TBO
	bool LoadImage2D(IFilePtr pFile, TImage2D &sImage);				// T2D, S2D
	bool LoadImage3D(IFilePtr pFile, TImage3D &sImage);				// VOL, T3D
	bool LoadImageArray2D(IFilePtr pFile, array<TImage2D> &aImages);	// CBM, T2A, CMA
	
	bool LoadSprite2D(IFilePtr pFile, TSprite2D &sSprite);

}	// Loaders
}	// Engine

#endif	// _UX_IMAGE_LOADER_H